import time

from tools import ActionUtil


def fighting(skill_list, skill_index):
    print("攻击！！！")
    length = len(skill_list)

    # 打印当前时间
    # 释放技能
    key = skill_list[skill_index]
    ActionUtil.press_delay(key, 0.1)
    time.sleep(1)

    skill_index += 1

    if skill_index >= length:
        skill_index = 0

    # 普攻
    ActionUtil.press_delay("x", 3)
    return True, skill_index
